package com.jxw.studyrecordprovider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/* loaded from: classes.dex */
public class DbOpenHelper extends SQLiteOpenHelper {
    public static final String AID = "_id";
    public static final String CREATE_TABLE_SQL = "CREATE TABLE studyrecord_tb(_id integer primary key autoincrement not null,modul_name text not null,modul_enter_time text not null,modul_exit_time text not null,modul_activity_duration text not null,modul_type integer not null,is_upload integer)";
    public static final String DBNAME = "study_db";
    public static final String IS_UPLOAD = "is_upload";
    public static final int MIDDLE = 2;
    public static final String MODUL_ACTIVITY_DURATION = "modul_activity_duration";
    public static final String MODUL_ENTER_TIME = "modul_enter_time";
    public static final String MODUL_EXIT_TIME = "modul_exit_time";
    public static final String MODUL_NAME = "modul_name";
    public static final String MODUL_TYPE = "modul_type";
    public static final int PRIMARY = 1;
    public static final String TABLENAME = "studyrecord_tb";
    public static final int VERSION = 2;

    public DbOpenHelper(Context context) {
        super(context, DBNAME, (SQLiteDatabase.CursorFactory) null, 2);
    }

    @Override // android.database.sqlite.SQLiteOpenHelper
    public void onCreate(SQLiteDatabase sQLiteDatabase) {
        sQLiteDatabase.execSQL(CREATE_TABLE_SQL);
    }

    @Override // android.database.sqlite.SQLiteOpenHelper
    public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
        if (i == 1) {
            sQLiteDatabase.execSQL("alter table studyrecord_tb add column is_upload integer");
        }
    }
}
